#ifndef AudioTransportImpl_H
#define AudioTransportImpl_H

#include "audio_device_defines.h"
#include "jni_api.h"

class AudioTransportImpl : public webrtc::AudioTransport, public JniCallbackGlobal
{
public:
	AudioTransportImpl(void);
	~AudioTransportImpl(void);

protected:	//JniCallbackBase
	virtual bool init_jni(JNIEnv* env);

public:
	virtual int32_t RecordedDataIsAvailable(const void* audioSamples,
		const uint32_t nSamples,
		const uint8_t nBytesPerSample,
		const uint8_t nChannels,
		const uint32_t samplesPerSec,
		const uint32_t totalDelayMS,
		const int32_t clockDrift,
		const uint32_t currentMicLevel,
		uint32_t& newMicLevel);   

	virtual int32_t NeedMorePlayData(const uint32_t nSamples,
		const uint8_t nBytesPerSample,
		const uint8_t nChannels,
		const uint32_t samplesPerSec,
		void* audioSamples,
		uint32_t& nSamplesOut);

protected:
	jmethodID m_midRecordedDataIsAvailable;
	jmethodID m_midNeedMorePlayData;
};

#endif //!AudioTransportImpl_H
